<div style="width:670px; float:left; padding-left:5px; margin-left:5px" class="content_right_group_admin box_shadow">

<?php 

	include_once("../../coms/xl_thongtin.php");

	include_once("../../include/ckeditor/ckeditor.php");

	if(isset($_POST['btn_CapNhat']))

	{

		$tenthongtin = $_POST['txt_tenthongtin'];		

		$noidung = $_POST['noidung'];

		$mathongtin = $_POST['hd_mahinh'];

		//$thumbnail = "hinhanhthicong/thumbnail/thumb_".$_FILES['up_hinh']['name'];	

		$kq=array();

		$update = new xl_thongtin();

		$ketqua = $update->CapNhatDiaChi($mathongtin, $tenthongtin, $noidung);

		echo '<meta http-equiv="refresh" content="0;url=trangchu.php?key=qldc" />';

		

	}	

	//Nếu là cập nhật liên kết 

	if(isset($_REQUEST['act']) && isset($_REQUEST['id'])):

		$act = $_REQUEST['act'];

		$id = $_REQUEST['id'];

		$maloaitrang = $_REQUEST['malt'];

		if($act == 'upd' && is_numeric($id)):

			$ban = new xl_thongtin();

			$arr_bn = $ban->Load_Thong_Tin_Theo_Loai_Trang_va_ID($maloaitrang,$id);

?>

<form method="post" name="fr_capnhatdiachi" action="trangchu.php?key=sdc" enctype="multipart/form-data" >

    <table width="60%" align="center"  cellpadding="0" cellspacing="0" style="font-size:12px">

        <tr>

            <td colspan="2" align="center" height="40px"><span style="font-size:18px; font-weight:bold; color:#f9d765; ">Thêm địa chỉ mới</span></td>

        </tr>

        <tr>

            <td width="30%" style="padding-left:5px;" height="30px" align="left">Tên địa chỉ<span style="color:#F00">(*)</span></td>

            <td align="left"><input type="text" name="txt_tenthongtin" size="30" style="height:20px;" class="border_radius" value="<?php echo $arr_bn[0]['tenthongtin']; ?>">

            <input type="hidden" name="hd_mahinh" value="<?php echo $arr_bn[0]['mathongtin']; ?>">

            </td>

        </tr>

         <tr>

            <td colspan="2" align="left" style="vertical-align:middle;">

                &nbsp;Thông tin địa chỉ<br>

				<?php 

					$CKEditor_NoiDung = new CKEditor();

					$CKEditor_NoiDung->basePath = '../../include/ckeditor/';

					$CKEditor_NoiDung->config['height'] = 120;

					$CKEditor_NoiDung->config['width'] = 590;

					$CKEditor_NoiDung->editor("noidung",$arr_bn[0]['noidung']);

				?>

            </td>

        </tr>

        <tr>

            <td colspan="2" align="center" style="vertical-align:middle;">

                 <input type="submit" name="btn_CapNhat" value="Cập nhật" class="button small blue" style="margin-top:10px;"/>

                <input type="button" name="btn_QuayLai" value="Quay lại" class="button small blue" style="margin-top:10px;" onclick="history.back()"/>

            </td>

        </tr>

    </table>

</form>

<?php			

		endif;

	endif;

	

?>

</div>